﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ListViewDemo.view
{
    /// <summary>
    /// BHClassView.xaml 的交互逻辑
    /// </summary>
    public partial class BHClassView : UserControl
    {
        //public readonly List<BHClass> bhClasses = [];
        public ObservableCollection<BHClass> bhClasses = [];
        public BHClassView()
        {
            InitializeComponent();
            //bHClasses.Add(new BHClass() { });
            bhClasses.Add(new () { BHID = 0, ImgPath= "/res/00-龟裂-1.png",      BHName = "龟裂",     ShortKey = "1" });
            bhClasses.Add(new () { BHID = 1, ImgPath = "/res/01-块状裂缝-2.png", BHName = "块状裂缝", ShortKey = "2" });
            bhClasses.Add(new () { BHID = 2, ImgPath = "/res/02-纵向裂缝-3.png", BHName = "纵向裂缝", ShortKey = "3" });
            bhClasses.Add(new () { BHID = 3, ImgPath = "/res/03-横向裂缝-4.png", BHName = "横向裂缝", ShortKey = "4" });
            bhClasses.Add(new () { BHID = 4, ImgPath = "/res/04-沉陷-5.png",     BHName = "沉陷",     ShortKey = "5" });
            bhClasses.Add(new () { BHID = 5, ImgPath = "/res/05-伸缩缝-6.png",   BHName = "伸缩缝",   ShortKey = "6" });
            bhClasses.Add(new () { BHID = 6, ImgPath = "/res/06-波浪拥包-7.png", BHName = "波浪拥包", ShortKey = "7" });
            //bhClasses.Add(new () { BHID = 7, ImgPath = "/res/07-坑槽-8.png",     BHName = "坑槽",     ShortKey = "8" });
            //bhClasses.Add(new () { BHID = 8, ImgPath = "/res/08-松散-9.png",     BHName = "松散",     ShortKey = "9" });
            //bhClasses.Add(new () { BHID = 9, ImgPath = "/res/09-泛油-F1.png",    BHName = "泛油",     ShortKey = "A" });
            //bhClasses.Add(new () { BHID =10, ImgPath = "/res/10-条修-F2.png",    BHName = "条修",     ShortKey = "B" });
            //bhClasses.Add(new () { BHID =11, ImgPath = "/res/11-块修-F3.png",    BHName = "块修",     ShortKey = "C" });
            lvBHClass.ItemsSource = bhClasses;
            //DataContext = this;
        }
    }

    [ObservableObject]
    public partial class BHClass
    {
        public int BHID { get; set; } = 0;
        public string ImgPath { get; set; } = string.Empty;
        public string BHName { get; set; } = string.Empty;
        public string ShortKey {  get; set; } = string.Empty;
    }
}
